package com.miyu.system.controller;

import com.alibaba.fastjson2.JSONObject;
import lombok.RequiredArgsConstructor;
import net.dreamlu.mica.redis.cache.MicaRedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
@RequiredArgsConstructor
public class TestController {

    private final MicaRedisCache redisCache;
    @RequestMapping("test")
    public String test(){
        Object o = redisCache.get("system:menu:routes:routes");
        JSONObject jo = new JSONObject();
        jo.put("routes", "测试");
        jo.put("msg","aaaa");

        redisCache.set("test",jo);
        JSONObject jo1 = redisCache.get("test");
        System.out.println(jo1);
        System.out.println(o);
        System.out.println("ceshi.....");
        return "ceshi";
    }
}
